import time
from pexpect import run

from app.modules.apps.container_ad import AdempiereApp

ad = AdempiereApp(app_id='vm.common.usaws.area:erp',
                  app_name='erp',
                  zone_home_path='/usr/local/app/vm.common.usaws.area',
                  zone_alias='bemo',
                  port='20080',
                  nas_app_package_path='/mnt/build/tms/123',
                  db_name='ERP')

ad.stop()
print ad.is_started()

ad.uninstall_app()
ad.install_app()
ad.restart()
time.sleep(3)
print ad.is_started()

ad.stop()
time.sleep(3)
print ad.is_started()
